package com.guobox.movies.present;

import com.guobox.movies.entity.MovieEntity;
import com.guobox.movies.usecase.MovieDetailModel;
import com.guobox.movies.usecase.MovieDetailModelImp;
import com.guobox.movies.view.MovieDetailActivityIf;

/**
 * Created by xuxinlei on 2017/7/4.
 */

public class MovieDetailPresentImp implements MovieDetailPresent {
    private MovieDetailActivityIf movieDetailActivityIf;
    private MovieDetailModel movieDetailModel;

    public MovieDetailPresentImp(MovieDetailActivityIf movieDetailActivityIf) {
        this.movieDetailActivityIf = movieDetailActivityIf;
        movieDetailModel = new MovieDetailModelImp(this);
    }

    @Override
    public void getMovieDetailRequest(MovieEntity movieEntity) {
        movieDetailModel.getMovieDetailFromServer(movieEntity);
    }

    @Override
    public void MovieDetailCallback(MovieEntity movieEntity) {
        movieDetailActivityIf.refreshDetail(movieEntity);
    }


    @Override
    public void MoviePosterColorCallback(String[] colors) {
        movieDetailActivityIf.refreshColors(colors);
    }
}
